import request from '../utils/request';

export const fetchData = query => {
    return request({
        url: './table.json',
        method: 'get',
        data: query
    });
};
//登录
export const login = query => {
    return request({
        url: '/super/login',
        method: 'get',
        data: query
    });
};
//首页
export const dash1 = query => {
    return request({
        url: '/index/orderData',
        method: 'post',
        data: query
    });
};

export const dash2 = query => {
    return request({
        url: '/index/rescueState',
        method: 'post',
        data: query
    });
};

export const dash3 = query => {
    return request({
        url: '/index/todayTotalOrder',
        method: 'post',
        data: query
    });
};

export const dash4 = query => {
    return request({
        url: '/index/userCount',
        method: 'post',
        data: query
    });
};
//用户管理
export const user = query => {
    return request({
        url: '/user/all',
        method: 'get',
        data: query
    });
};

export const out = query => {
    return request({
        url: '/user/all',
        method: 'get',
        data: query
    });
};
//商户管理
export const sort = query => {
    return request({
        url: '/business/businessList',
        method: 'get',
        data: query
    });
};

export const detailed = query => {
    return request({
        url: '/business/getBusinessById',
        method: 'get',
        data: query
    });
};

export const delet = query => {
    return request({
        url: '/business/review',
        method: 'get',
        data: query
    });
};

//服务管理
export const serve = query => {
    return request({
        url: '/services/all',
        method: 'get',
        data: query
    });
};

export const serveAdd = query => {
    return request({
        url: '/services/add',
        method: 'post',
        data: query
    });
};

export const serveEidt = query => {
    return request({
        url: '/services/update',
        method: 'post',
        data: query
    });
};

export const serveOut = query => {
    return request({
        url: '/services/update',
        method: 'post',
        data: query
    });
};

export const del = query => {
    return request({
        url: '/services/delete',
        method: 'delete',
        data: query
    });
};

//订单管理
export const order = query => {
    return request({
        url: '/order/countOrder',
        method: 'get',
        data: query
    });
};

export const car = query => {
    return request({
        url: '/order/洗车订单_',
        method: 'get',
        data: query
    });
};


export const service = query => {
    return request({
        url: '/order/维修订单_',
        method: 'get',
        data: query
    });
};

export const maintain = query => {
    return request({
        url: '/order/保养订单_',
        method: 'get',
        data: query
    });
};

export const detail = query => {
    return request({
        url: '/order/comment',
        method: 'get',
        data: query
    });
};

//救援任务
export const rescue = query => {
    return request({
        url: '/rescue/all',
        method: 'post',
        data: query
    });
};

//信息发布
export const message = query => {
    return request({
        url: '/information/all',
        method: 'get',
        data: query
    });
};

export const messageout = query => {
    return request({
        url: '/information/upAndDown',
        method: 'get',
        data: query
    });
};

//已审核
export const message1 = query => {
    return request({
        url: '/information/issue',
        method: 'post',
        data: query
    });
};

//订单统计
export const statis = query => {
    return request({
        url: '/order/countOrderPage',
        method: 'get',
        data: query
    });
};

